package com.txzt.gaea.common.enums;

public enum DeviceType {

    /**
     * 个人设备
     */
    PERSONAL("personal","个人设备"),
    /**
     * 公用设备
     */
    PUBLIC("public","公用设备"),
    /**
     * 保密设备
     */
    SECRECY("secrecy","保密设备"),
    ;

    private final String code;

    private final String info;

    DeviceType(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfoByCode(String code){
        DeviceType[] statuses = values();
        for (DeviceType status:statuses){
            if (status.getCode().equals(code)) {
                return status.getInfo();
            }
        }
        return "";
    }
}
